package com.ruoyi.report.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.report.domain.BusinessReport;
import com.ruoyi.report.mapper.BusinessReportMapper;
import com.ruoyi.report.service.IBusinessReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * description
 *
 * @author h w
 * @version 1.0
 * @date 2023/2/4 19:35
 */
@Service
public class BusinessReportServiceImpl implements IBusinessReportService {

    @Autowired
    private BusinessReportMapper businessReportMapper;

    @Override
    public List<BusinessReport> selectBusinessReportList(BusinessReport businessReport) {
        List<BusinessReport> list = businessReportMapper.selectBusinessReportList(businessReport);
        for (BusinessReport report : list) {
            report.setStationHours(String.valueOf(DateUtils.getDifferHour(report.getConfirmTime(), report.getGetOutTime())));
        }
        return list;
    }

}
